package com.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2022-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000119657480";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCtP7Gz7ZOwlBbRbA0m8phtfZQ4cc2MI/4AxWvj1gm9SngXILET5WDyj9lD2ynf79yZiBayGYW2HWJksWWcW6kTCVTIvZeEvt4Mgikbe0aqvnvp5ei20u09w/H3jCcwenHS7hCjCdHDs/kxN9SrrkIKoU5IbtkfQ6AokDg2icWYDMHXHTIKQqDZGPjQMbHopQhGe9we9+6Kn5ghdzEK5lCQSaEBEZfkMA9ZNO8Lb9Jxkd1z0sfTxPilr8pIzutTdxDlFOv9StPON3ZTyYYDL/xeEi5rjVGZOXYczT0SmshRV3P8nhabW2ENNMwubd46luTSWu21WDl+es6lZ3IXGvP9AgMBAAECggEANC7nO6bnwVwZs2K0Y3LW7sPQjV/Z5chBjcHpSWsC6/0uRukV7UQ9+1HQw1uUNVtuOuB+1Y5SdBRNur6kOIBzYMSCwSQ6K0XCZEogT6LGGk/dywnxGoBV7TDEBSg19agr+Li0Uid3A1eGS4jhigSm58TGa5LX207nQtCN3f+JgM52k9s1gT5b5moSh9Li0C5PTnpupz0CjLpY4UjhVjtOVirf6F9x26KNAf5REjW1Qirg65ilWvdQFHJ1pBbB7JMKbmX/jC7p1jYfXhPu9Hvw+0fFE2Vx0w9psBZfYAbnjnULviYlvJ1b3WwsqMfH3eHqEasDJoH6tdJ38uyc/Wo7kQKBgQD05Q5gvT8Pgp6xje6COLKbvOV/4Pcyo2ntIVhHGU57WHUG5ZDvDux8q+I6Mgcdum8fPP0mpGeOBXMSXfVV6Nt6ruCFZ5dXcIj3Yt9eX6GjHQb+x4bpb259wNyQppdRXZx7CzaSQB1Tv9HIGuKuL1l3nfkZA85tszE57xhYp344/wKBgQC1GulmBM58REvJYxSe6wRuV8PxdozgFsRNN2VgikBC9xNX0l485PoBu6YvNsx3m+ZfgunzuOAMbNk/iSpTcN8+a/DjDhHRr0fQ5mSrL9axwwf3G8UvWrG/39sZyzmtw/+FlbfEpRJDhtzyEEUY1aFw5KMhSs/3XwKlSzulyB63AwKBgQDp6oyUPM+qOgLo6ABE5HE+Lu0r+69C8DIyraILr5F2YeTOZKLOpXugDfI10ilX7QdNWE0aBvle/7eNeK/pklVqVvXglzVI8RXy7r8a/s9+5TAUVnN4L9bjST+k72sj7f2Uzf4fLhyVLWjs8TlKVbHofr07dpZL1FiV1Np1e+8l8wKBgA+NbBWyu/i39LoqpA6xqAPBzbXitF5aFil7ZF1SAgq+JQ8ZpbYdA8s6Th8n2Y87+CCjoWuoqLTodA+cu+HGg6Vcp6cYAje7kbNC1cpNpWZGlVyHKfvTEgikNLCWXzGo7zyNiuZ8NoFOB5NSCl0Dm4WSXN/zCMD5i8SeHVUzRk/5AoGBAMj+2+S0iuPzw+NYpoUcNJDvsYfPEXiJA1n8mKJxV7RLmYQOzrD0DYJMr2Vimxm1lq3OsonOrm7wuzoMJsQ4THqPwQ1lRXqU/59663z1KRxhCJfFi/F9g48rEzHeqe9zGGBIrJMm9pvPlqykPqnzz08p/Y2H69YRiX/MF/IDvdJx";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAht1x5XVkDDDkAz3/9exCgwY84bk/kcWwu4qbCBc61coSxeiqMVW+CkmKES/5fl+gdmnMoryhPBTD1QCCWVo35BtAGbf+n8vw+IbHpmVSeOuGtAZGl7MOxam59p4rL32AiLrX32nfgZKpPUq44GaYnH4g8G4OZ964YsYH7pDJrS3jH3Vc5prlT2BC1bHEnhqM2b3Fqd5mpTW048zjDjfaTXoUHmskjp/nTJzpvOA5a4XiMR/dUIgIg7sECheQauuU6GTH56XX4FfQ3AaPGoB+qHNx9r+5XPtStBHtL1T9GDHgEIOR1Fe9Vfw4cqtVO2qYZ1vEgKrHNSKaLAPG6aV0uQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url ="http://4i2ahx.natappfree.cc/springbootqd7xr/";
            //"http://localhost:8080/springbootqd7xr/";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/springbootqd7xr/admin/dist/index.html#/";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl ="https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\biye\\log";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

